<?php
//�������ļ�
require '../Smarty/libs/Smarty.class.php';
//����smarty����
$smarty = new Smarty;

$smarty->template_dir = '../Smarty/templates';

$smarty->compile_dir = '../Smarty/templates_c';
$smarty->config_dir = '../Smarty/config';

$smarty->cache_dir = '../Smarty/cache';

//smartyģ���и��ٻ���Ĺ��ܣ����������true�Ļ�����caching�����ǻ������ҳ���������µ����⣬��ȻҲ����ͨ������İ취���
$smarty->caching = false;

//ҵ������
$dom = new DOMDocument();
if (!$dom->load('../goodway/xml/4cjdx7.xml'))
{
	echo "load books.xml failed!<br>";
}
	
$domindex = $dom->getElementsByTagName('indeximgnum');
$index_top = $domindex->item(0)->getAttribute('value');


require_once '../bin/DBA/DB.class.php';
require_once '../bin/DAL/RegardingDAL.php';
require_once '../bin/BLL/RegardingBLL.php';
require_once '../bin/DAL/ProductsDAL.php';
require_once '../bin/BLL/ProductsBLL.php';
require_once '../bin/DAL/ContactDAL.php';
require_once '../bin/BLL/ContactBLL.php';

$comapny = RegardingBLL::GetItemByDeu_Regarding();
$content = $comapny["content"];

if (strlen($content)>110)
{
	$content = substr($content,0,110);
}

$products = ProductsBLL::GetItemByChs_Products_Top($index_top);

$contact = ContactBLL::GetObjectByChs_Contact();
$address = $contact["address"];
$name = $contact["name"];
$phone = $contact["telephone"];
$fax = $contact["fax"];
$mail = $contact["email"];
//��ֵ
$smarty->assign('company',$content);
$smarty->assign('count',$index_top);
$smarty->assign('products',$products);
$smarty->assign('address',$address);
$smarty->assign('name',$name);
$smarty->assign('phone',$phones);
$smarty->assign('fax',$fax);
$smarty->assign('mail',$mail);
//����ģ���ļ�
$smarty->display('Deu/index.tpl');
?>